package com.woniuxy.mapper;

import com.woniuxy.entity.Student;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 作者
 * @create 2025-06-18 10:42
 */
public interface StudentMapper {
    void insert(Student student);
    void update(Student student);
    void deleteById(int id);
    Student selectById(int id);
    List<Student> selectAll();
    //根据姓名模糊查询
    List<Student> selectByName(String name);
    List<Student> selectByName01(@Param("name") String name);
    List<Student> selectByNameAndAge(@Param("name") String name,
                                     @Param("age") int age);
    List<Student> selectByNameAndAge01(Student student);
    List<Student> selectByNameAndAge02(@Param("student") Student student);
    List<Student> selectByNameAndAge03(@Param("student") Student student,
                                       @Param("age") int age);

    //多条件组合 if
    List<Student> selectByCondition(Student student);
    //多条件组合 where
    List<Student> selectByCondition01(@Param("student") Student student);
    List<Student> selectByCondition02(Student student);
    //choose-when-otherwise
    List<Student> selectByCondition03(Student student);
    //foreach SELECT * FROM student WHERE id IN(1,3,5)
    List<Student> selectByIds(int[] ids);
    List<Student> selectByIds01(List<Integer> ids);
    void insertBatch(List<Student> students);
    void insertBatch01(@Param("students")List<Student> students);
    int selectConditionCount(@Param("student")Student student);
    List<Student> selectConditionData(@Param("student")Student student,
                                      @Param("pageIndex")int pageIndex,
                                      @Param("pageSize")int pageSize);
    List<Student> selectPagerByPlugin(@Param("student")Student student);
}
